package com.iva.model;

// Generated 11-03-2013 09:07:49 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbSedeHasPersonal generated by hbm2java
 */
@Entity
@Table(name = "tb_sede_has_personal", catalog = "new_escool")
public class TbSedeHasPersonal implements java.io.Serializable {

	private Integer idSedeHasPersonal;
	private TbSede tbSede;
	private TbPersonal tbPersonal;
	private String nombreCompleto;
	private Set<TbSedePersonalHasRol> tbSedePersonalHasRols = new HashSet<TbSedePersonalHasRol>(
			0);

	public TbSedeHasPersonal() {
	}

	public TbSedeHasPersonal(TbSede tbSede, TbPersonal tbPersonal) {
		this.tbSede = tbSede;
		this.tbPersonal = tbPersonal;
	}

	public TbSedeHasPersonal(TbSede tbSede, TbPersonal tbPersonal,
			String nombreCompleto,
			Set<TbSedePersonalHasRol> tbSedePersonalHasRols) {
		this.tbSede = tbSede;
		this.tbPersonal = tbPersonal;
		this.nombreCompleto = nombreCompleto;
		this.tbSedePersonalHasRols = tbSedePersonalHasRols;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_sede_has_personal", unique = true, nullable = false)
	public Integer getIdSedeHasPersonal() {
		return this.idSedeHasPersonal;
	}

	public void setIdSedeHasPersonal(Integer idSedeHasPersonal) {
		this.idSedeHasPersonal = idSedeHasPersonal;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tb_sede_id_sede", nullable = false)
	public TbSede getTbSede() {
		return this.tbSede;
	}

	public void setTbSede(TbSede tbSede) {
		this.tbSede = tbSede;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tb_personal_id_personal", nullable = false)
	public TbPersonal getTbPersonal() {
		return this.tbPersonal;
	}

	public void setTbPersonal(TbPersonal tbPersonal) {
		this.tbPersonal = tbPersonal;
	}

	@Column(name = "nombreCompleto")
	public String getNombreCompleto() {
		return this.nombreCompleto;
	}

	public void setNombreCompleto(String nombreCompleto) {
		this.nombreCompleto = nombreCompleto;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbSedeHasPersonal")
	public Set<TbSedePersonalHasRol> getTbSedePersonalHasRols() {
		return this.tbSedePersonalHasRols;
	}

	public void setTbSedePersonalHasRols(
			Set<TbSedePersonalHasRol> tbSedePersonalHasRols) {
		this.tbSedePersonalHasRols = tbSedePersonalHasRols;
	}

}
